package com.qianbei.view.bluetooth;

import android.content.Context;

import com.qianbei.R;
import com.qianbei.common.adapter.CommonAdapter;
import com.qianbei.common.adapter.ViewHolder;

/**
 * <pre>
 *     author : pipi
 *     e-mail : xxx@xx
 *     time   : 2018/09/29
 *     desc   :
 *     version: 1.0
 * </pre>
 */

public class DeviceScanAdapter extends CommonAdapter<BTDevice>{
    public DeviceScanAdapter(Context context) {
        super(context, R.layout.item_device_scan);
    }

    @Override
    public void convert(ViewHolder helper, BTDevice item, int position) {
        helper.setText(R.id.tv_name, item.getName())
                .setText(R.id.tv_addr, item.getAddr())
                .setText(R.id.tv_rssi, item.getRssi()+"dBm");
    }

    protected void addData(BTDevice btDevice) {
        this.mDatas.add(btDevice);
        notifyDataSetChanged();
    }
}
